package com.lifang.imsoa.base.service;

import com.lifang.imsoa.util.Global;
import com.lifang.utils.WebTool;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class QuartzTaskBase {

	private static boolean runFlag = false;

	public static boolean isRun() {
		return runFlag;
	}

	private static void setRunFlag(boolean runFlag) {
		QuartzTaskBase.runFlag = runFlag;
	}

	static {
		String ip = WebTool.getHostName();
		log.info("获取本机 ip : {}", ip);
		if (Global.QUARTZTASK_RUN_IP.equals(ip)) {
			setRunFlag(true);
		}

	}
}
